CC=gcc
CFLAGS=-Wall -g
LIBS=-lpthread
COMPILE=$(CC) $(CFLAGS)
OBJECTS=modulux.o cluster.o registry.o program_cl.o proc_control.o dep_list.o identity.o dummy.o primitives.o

all: modulux

modulux: modulux.o objects
	$(COMPILE) $(OBJECTS) -o modulux $(LIBS)

modulux.o: modulux.c objects
	$(COMPILE) -c modulux.c $(LIBS)

objects: cluster registry proc_control program_cl dep_list identity dummy primitives

program_cl: cluster registry proc_control dummy
	$(COMPILE) -c Objects/program_cl.c $(LIBS)

dummy: cluster
	$(COMPILE) -c Objects/dummy.c $(LIBS)

registry: cluster
	$(COMPILE) -c Objects/registry.c $(LIBS)

proc_control: cluster
	$(COMPILE) -c Objects/proc_control.c $(LIBS)

dep_list: cluster
	$(COMPILE) -c Objects/dep_list.c $(LIBS)

identity: cluster
	$(COMPILE) -c Objects/identity.c $(LIBS)

primitives: cluster
	$(COMPILE) -c Objects/primitives.c $(LIBS)

cluster:
	$(COMPILE) -c Objects/cluster.c $(LIBS)

dox:
	doxygen Doc/modulux_doxyfile

clean:
	rm -f modulux *.o$

unlock:
	rm -f ./.*.swp Objects/.*.swp Headers/.*.swp$

clean_dox:
	rm -rf Doc/api
